home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 2 / Gold Medal Software Volume 2 (Gold Medal) (1994).iso / os2 / cenvi2.arj / KEYGHOST.CMD < prev    next >
OS/2 REXX Batch file  |  1993-12-21  |  2KB  |  66 lines

  1. EXTPROC CEnvi
  2. // KeyGhost.cmd - Example for how to control other programs using the
  3. //                the keyboard stuffing routines in KeyPush.Lib.
  4.  
  5. #include <KeyPush.lib>
  6.  
  7. // Start e.exe running, and give it time to get going
  8.    system("Start /F /N E.EXE");
  9.    suspend(3000)
  10.  
  11. // Let's use a BIG helvetica font
  12.    //KeyStroke(VK_ALT,'o');  // options
  13.    //KeyStroke('f');         // fonts
  14.    //SpeedKeys("Helv");      // select the Helvetica font
  15.    //KeyStroke(VK_TAB),KeyStroke(VK_TAB);   // Tab twice to get to size
  16.    //KeyStroke(VK_PAGEDOWN); // page down to a BIG font
  17.    //KeyStroke(VK_ENTER);    // Select OK
  18.  
  19.  
  20. // Enter initial CEnvi sentence
  21.    SpeedKeys("CEnvi is good.");
  22.  
  23. // Change "good" to "great"
  24.    for ( i = 0; i < 5; i++ )
  25.       KeyStroke(VK_SHIFT,VK_LEFT)
  26.    SpeedKeys("great!");
  27.  
  28. // Figure out how much it costs per day for a year
  29.    SpeedKeys("\r\rIs CEnvi worth 38 dollars?"
  30.              "\rTo use it every day for a year costs ");
  31.  
  32. // Bring up calculator to figure $38.00 / 365 * 10
  33.    system("start /PM /B PMDCalc.EXE");
  34.    suspend(1000);
  35.    system("call Switch Calculator");
  36.  
  37. // Perform calculation for costs
  38.    SpeedKeys("A38.00/365=*100=",200);   // perform calculation
  39.    suspend(500);
  40.  
  41. // Kill the calculator
  42.    suspend(3000);
  43.    KeyStroke(VK_ALT,VK_F4);
  44.  
  45. // Print the results of the calculation
  46.    SpeedKeys("10.4",100);
  47.    SpeedKeys(" pennies a day.\rWhat a bargain!");
  48.  
  49. // now print the message to register
  50.    SpeedKeys("\r\rRegister now!");
  51. // copy the Register message just printed and print it many more times
  52.    KeyStroke(VK_SHIFT,VK_HOME);
  53.    KeyStroke(VK_SHIFT,VK_UP);
  54.    KeyStroke(VK_CTRL,VK_INSERT);
  55.    KeyStroke(VK_DOWN), KeyStroke(VK_END);
  56.    KeyStroke(VK_RIGHT); // just in case not ALL the way at the end
  57. // print that message another 15 times
  58.    for ( i = 0; i < 7; i++ )
  59.       KeyStroke(VK_SHIFT,VK_INSERT);
  60.  
  61. // finally, say goodbye and exit
  62.    suspend(500);
  63.    SpeedKeys("\rThank you.");
  64.    KeyStroke(VK_ALT,VK_F4);
  65.    KeyStroke('d');
  66.